<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored="false" %>
<html>
<head>
    <title>书籍列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
<%--    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">--%>
    <link rel="stylesheet" href="../../bootstrap.min.css">
</head>
<body>

<div class="container">

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>书籍列表 —— 显示所有书籍</small>
                </h1>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4 column">
            <a  href="${pageContext.request.contextPath}/book/ToAddBookPage"><button type="button" class="btn btn-success">新增</button></a>
            <a  href="${pageContext.request.contextPath}/book/AllBook"><button type="button" class="btn btn-primary">返回</button></a>

        </div>
        <div class="col-md-4 column">

        </div>
        <form action="${pageContext.request.contextPath}/book/QueryBook" method="post">
            <div class="col-md-3 column">
            <input type="text" name="queryName" placeholder="请输入查询的书籍" class="form-control">

        </div>
            <div class="col-md-1" style="padding-left: 0px">
                <button class="btn btn-info">查询</button>
            </div>
        </form>

    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-bordered table-responsive info table-striped">
                <thead>
                <tr class="info">
                    <th>书籍编号</th>
                    <th>书籍名字</th>
                    <th>书籍数量</th>
                    <th>书籍详情</th>
                    <th>时间</th>
                    <th>操作</th>
                </tr>
                </thead>


                <tbody>
                <c:forEach var="book" items="${requestScope.get('booklist')}">
                    <tr>
                        <td>${book.getBookID()}</td>
                        <td>${book.getBookName()}</td>
                        <td>${book.getBookCounts()}</td>
                        <td>${book.getDetail()}</td>
                        <td>${book.getBdate()}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/book/toUpdateBook?id=${book.getBookID()}"><button type="button" class="btn btn-info">修改</button></a>
                            <a href="${pageContext.request.contextPath}/book/delete/${book.getBookID()}"><button type="button" class="btn btn-danger">删除</button></a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <div>  <h4>${msg}</h4></div>
        </div>
    </div>
</div>
